﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Common.Logging;
using WuDada.Core.Post;
using WuDada.Core.Post.Service;
using WuDada.Core.Post.Domain;

public partial class online_in : System.Web.UI.Page
{
    private ILog m_Log = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
    private PostFactory m_PostFactory;
    private IMessageService m_MessageService;

    protected void Page_Load(object sender, EventArgs e)
    {
        m_PostFactory = new PostFactory();
        m_MessageService = m_PostFactory.GetMessageService();

        if (!IsPostBack)
        {
            LodaDataToUI();
        }
    }

    private void LodaDataToUI()
    {
        int id = QueryStringHelper.GetInteger("id", 0);
        MessageVO messageVO = m_MessageService.GetMessageById(id);

        if (messageVO != null && messageVO.UserAgreePublish && messageVO.AdminAgreePublish)
        {
            ltlTitle.Text = messageVO.Title;
            ltlContent.Text = messageVO.Content.Replace("\n", "<br />");
            ltlHtmlContent.Text = messageVO.Answer;
        }
    }
}